﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Templates_ControlTypes : BasePage
{
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        dsTypes.SelectData += new EventHandler<Acms.DataControls.SelectEventArgs<Acms.Bll.ControlType>>(dsTypes_SelectData);
        lnkAdd.Click += new EventHandler(lnkAdd_Click);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    void lnkAdd_Click(object sender, EventArgs e)
    {
        grid.MasterTableView.IsItemInserted = true;
        grid.Rebind();
    }

    void dsTypes_SelectData(object sender, Acms.DataControls.SelectEventArgs<Acms.Bll.ControlType> e)
    {
        e.SetData(Acms.Bll.ControlType.GetAllBySiteId(AcmsContext.SiteId));
    }

    public override void GetBreadCrumbs(BaseMasterPage.BreadCrumbCollection breadcrumbs)
    {
        base.GetBreadCrumbs(breadcrumbs);
        breadcrumbs.AddSettings();
        breadcrumbs.Add("Content Control Types");

    }

    public override Acms.Bll.Role.Roles[] AllowedRoles
    {
        get { return new Acms.Bll.Role.Roles[] { Acms.Bll.Role.Roles.Developer }; }
    }
}
